package com.example.apiinterface.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

/**
 * 图片接口，随机返回1张图片
 * IP:8123/api/picture
 **/
@RestController
@RequestMapping("/picture")
public class PictureController {
    private static final Random random = new Random();
    private static final String[] numId = {"https://css.taoguba.com.cn/images/face/011.png",
            "https://css.taoguba.com.cn/images/face/018.png"};

    @GetMapping("/get")
    public String getPictureByGet() {
        return numId[random.nextInt(2)];
    }
}
